from toee import *
from toee import anyone

def san_dialog( attachee, triggerer ):
	if (anyone( triggerer.group_list(), "has_follower", 8001 )): 
		triggerer.begin_dialog( attachee, 150 )
	elif (game.global_flags[933] == 1):
		triggerer.begin_dialog( attachee, 200 )
	elif (attachee.map == 5007):
		triggerer.begin_dialog( attachee, 340 )
	elif (game.global_flags[38] == 1): 
		triggerer.begin_dialog( attachee, 200 )
	elif (game.global_flags[149] == 1): 
		triggerer.begin_dialog( attachee, 220 )
	else:
		triggerer.begin_dialog( attachee, 1 )
	return SKIP_DEFAULT

def make_hate( attachee, triggerer ):
	if ( attachee.reaction_get( triggerer ) >= 20 ):
		attachee.reaction_set( triggerer, 20 )
	return SKIP_DEFAULT

def san_first_heartbeat( attachee, triggerer ):
	if (game.quests[20].state == qs_completed) and (attachee.map == 5007):
		attachee.object_flag_set(OF_OFF)
		game.global_flags[933] = 1
	elif (attachee.map == 5044) and (game.global_flags[933] == 1):
		attachee.object_flag_unset(OF_OFF)
	return RUN_DEFAULT
